import { createRouter, createWebHashHistory, createWebHistory } from "vue-router";


let routes = [
    {
        path: '/',
        redirect: '/home'
    },
    {
        path: '/login',
        component: () => import('../view/login/login.vue'),
        meta: {
            title: "登录",
        }
    },
    {
        path: '/inde',
        name: '/index',
        component: () => import('../view/home/index.vue'),
        children: [
            {
                path: '/home',
                component: () => import('../view/home/home.vue'),
                meta: {
                    title: "首页",
                }
            },
            {
                path: '/digitalProduction/index',
                component: () => import('../view/digitalProduction/digitalProduction/index.vue'),
                children: [
                    {
                        path: '/digitalProduction/digitalProduction',
                        component: () => import('../view/digitalProduction/digitalProduction/digitalProduction.vue'),
                        meta: {
                            title: "数字生产",
                        },
                    },
                    {
                        path: '/digitalProduction/rubbish',
                        component: () => import('../view/digitalProduction/rubbish/rubbish.vue'),
                        meta: {
                            title: "垃圾给料",
                        }
                    },
                    {
                        path: '/digitalProduction/destructor',
                        component: () => import('../view/digitalProduction/destructor/destructor.vue'),
                        meta: {
                            title: "焚烧炉总貌",
                        }
                    },
                    {
                        path: '/digitalProduction/engineSystem',
                        component: () => import('../view/digitalProduction/engineSystem/engineSystem.vue'),
                        meta: {
                            title: "汽机总貌",
                        }
                    },
                ]
            },
            {
                path: '/dailyMaintenance/equipmentLedger',
                component: () => import('../view/dailyMaintenance/equipmentLedger/equipmentLedger.vue'),
                meta: {
                    title: "日常维护-设备台账",
                    noModel: true,
                },
            },
            {
                path: '/dailyMaintenance/repairRequest',
                component: () => import('../view/dailyMaintenance/repairRequest/repairRequest.vue'),
                meta: {
                    title: "日常维护-检修报修",
                    noModel: true,
                },
            },
            {
                path: '/dailyMaintenance/inspection',
                component: () => import('../view/dailyMaintenance/inspection/inspection.vue'),
                meta: {
                    title: "日常维护-日常巡检",
                    noModel: true,
                },
            },
            {
                path: '/dailyMaintenance/equipmentMaintenance',
                component: () => import('../view/dailyMaintenance/equipmentMaintenance/equipmentMaintenance.vue'),
                meta: {
                    title: "日常维护-设备维保",
                    noModel: true,
                },
            },
            {
                path: '/dailyMaintenance/schedulingManage',
                component: () => import('../view/dailyMaintenance/schedulingManage/schedulingManage.vue'),
                meta: {
                    title: "日常维护-排班管理",
                    noModel: true,
                },
            },
            {
                path: '/dailyMaintenance/workOrder',
                component: () => import('../view/dailyMaintenance/workOrder/workOrder.vue'),
                meta: {
                    title: "日常维护-工单统计",
                    noModel: true,
                },
            },
            {
                path: '/dailyMaintenance/systemDrawings',
                component: () => import('../view/dailyMaintenance/systemDrawings/systemDrawings.vue'),
                meta: {
                    title: "日常维护-系统图纸",
                    noModel: true,
                },
            },
            {
                path: '/dailyMaintenance/spareParts',
                component: () => import('../view/dailyMaintenance/spareParts/spareParts.vue'),
                meta: {
                    title: "日常维护-备品备件",
                    noModel: true,
                },
            },
            {
                path: '/alarmCenter/alarmCenter',
                component: () => import('../view/alarmCenter/alarmCenter.vue'),
                meta: {
                    title: "报警中心"
                },
            },
            {
                path: '/monitoring/powerDistribution',
                component: () => import('../view/monitoring/powerDistribution/powerDistribution.vue'),
                meta: {
                    title: "智能监控-供配电系统"
                },
            },
        ]
    },

]

// 路由
const router = createRouter({
    // history: createWebHashHistory(import.meta.env.VITE_BASE_URL),
    history: createWebHistory(import.meta.env.VITE_BASE_URL),
    routes
})
// 导出
export default router 